#include<iostream>
using namespace std;
class Solution {
public:
    void Reverse(string& s, int start, int end) {
        while (start < end) {
            swap(s[start], s[end]);
            ++start;
            --end;
        }
    }
    string reverseStr(string s, int k) {
        int i = 0;
        int end = s.size();
        for (; i < end; i += 2 * k) {
            if (i + k < end) {
                Reverse(s, i, i + k - 1);
            }
            else {
                Reverse(s, i, end - 1);
            }
        }
        return s;
    }
};
int main() {
    Solution s;

}